package pl.mikei.deliverydroid;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class TheBurgerPlaceActivity extends ListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setListAdapter(new BurgerAdapter(
				new Burger("Plain old Burger"),
				new Burger("Cheese Burger"),
				new Burger("Chicken Burger"),
				new Burger("Breakfast Burger"),
				new Burger("Hawaiian Burger"),
				new Burger("Fish Burger"),
				new Burger("Vegatarian Burger"),
				new Burger("Lamb Burger"),
				new Burger("Rare Tuna Steak Burger"),
				new Burger("Plain old Burger1"),
				new Burger("Cheese Burger1"),
				new Burger("Chicken Burger1"),
				new Burger("Breakfast Burger1"),
				new Burger("Hawaiian Burger1"),
				new Burger("Fish Burger1"),
				new Burger("Vegatarian Burger1"),
				new Burger("Lamb Burger1"),
				new Burger("Rare Tuna Steak Burger1")));
		
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		BurgerAdapter burgers = (BurgerAdapter)l.getAdapter();
		Burger burger = (Burger)burgers.getItem(position);
		
		burger.count++;
		burgers.notifyDataSetInvalidated();
		
		//super.onListItemClick(l, v, position, id);
	}
}
